home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / MWCC03 / EXAMPLES.ZIP / MWCCDLG.PAS next >
Pascal/Delphi Source File  |  1993-08-18  |  3KB  |  120 lines

  1. {**********************************************************************}
  2. {*                                                                    *}
  3. {*          Microworks Sample Application                                        *}
  4. {*                                                                    *}
  5. {*         for Borland Pascal v7.0 and Turbo Pascal for Windows v1.5           *}
  6. {*                                                                    *}
  7. {*     Copyright 1992-93 Jeff Franks (Microworks) Sydney, Australia.  *}
  8. {*                                                                    *}
  9. {*         You are free to use, modify, reproduce and distribute the      *}
  10. {*         Sample Files (and/or any modified version) in any way you      *}
  11. {*         find useful.                                                                *}
  12. {*                                                                    *}
  13. {**********************************************************************}
  14.  
  15. {*** Introduction
  16.  
  17.     Application    := Basic MWCC Dialog
  18.  
  19.     Files          := MWCCDlg.pas and MWCCDlg.res
  20.  
  21.     Units Required := MObjects and MWCC.dll
  22.  
  23.     Tabs           := 2
  24.  
  25.     Screen         := 800 * 600
  26.  
  27.     Date           := August, 1993.
  28.  
  29.     The TMWCCDialog object is not as versatile as TMWCCWindow and TMWCCDlgWindow. It simply
  30.     paints a 3D border around the client area and lets you add a BWCC or MWCC patterned
  31.     background. It does not support the use of an SFXFrame.
  32.  
  33.     Warning - Don't overide any inherited methods (not listed here) without first consulting
  34.               the documentation.
  35.  
  36. ***}
  37.  
  38. program MWCCDlg;
  39.  
  40. {$R MWCCDlg.res}
  41.  
  42. uses WinTypes, WinProcs, MObjects,
  43.          {$IFDEF Ver15}
  44.              WObjects;
  45.          {$ELSE}
  46.              Objects, OWindows, ODialogs;
  47.          {$ENDIF}
  48.  
  49. const
  50.  
  51.     AppName : PChar = 'NewMWCCDialog';
  52.  
  53. type
  54.  
  55.     PNewMWCCApplication = ^TNewMWCCApplication;
  56.     TNewMWCCApplication = object(TApplication)
  57.         procedure InitMainWindow; virtual;
  58.     end;
  59.  
  60.     PNewMWCCDialog = ^TNewMWCCDialog;
  61.     TNewMWCCDialog = object(TMWCCDialog)
  62.         constructor Init(AParent: PWindowsObject; AName, ABmp: PChar);
  63.       destructor Done; virtual;
  64.         function  GetClassName : PChar; virtual;
  65.         procedure SetUpWindow; virtual;
  66.         procedure WMPaint (var Msg: TMessage); virtual wm_First + wm_Paint;
  67.     end;
  68.  
  69. {********** TNewMWCCApplication **********}
  70.  
  71. procedure TNewMWCCApplication.InitMainWindow;
  72. begin
  73.     MainWindow := New(PNewMWCCDialog, Init(nil, 'Dialog', nil));
  74. end;
  75.  
  76. {********** TNewMWCCDialog **********}
  77.  
  78. constructor TNewMWCCDialog.Init(AParent: PWindowsObject; AName, ABmp: PChar);
  79. begin
  80.     TMWCCDialog.Init(AParent, AName, ABmp);
  81. end;
  82.  
  83. destructor TNewMWCCDialog.Done;
  84. begin
  85.     TMWCCDialog.Done;
  86. end;
  87.  
  88. function TNewMWCCDialog.GetClassName;
  89. begin
  90.   GetClassName := AppName;
  91. end;
  92.  
  93. procedure TNewMWCCDialog.SetUpWindow;
  94. var
  95.     X, Y, W, H: Integer;
  96. begin
  97.     TMWCCDialog.SetUpWindow;
  98.     X := GetSystemMetrics(sm_CXScreen) div 4;
  99.     Y := GetSystemMetrics(sm_CYScreen) div 4;
  100.     W := GetSystemMetrics(sm_CXScreen) div 2;
  101.     H := GetSystemMetrics(sm_CYScreen) div 2;
  102.     MoveWindow(HWindow, X, Y, W, H, True);
  103.     SetWindowText(Hwindow, 'MWCC Dialog');
  104. end;
  105.  
  106. procedure TNewMWCCDialog.WMPaint (var Msg: TMessage);
  107. begin
  108.     TMWCCDialog.WMPaint(Msg);
  109. end;
  110.  
  111. {********** Main program **********}
  112.  
  113. var
  114.     MWCCApp: TNewMWCCApplication;
  115. begin
  116.   MWCCApp.Init(AppName);
  117.   MWCCApp.Run;
  118.   MWCCApp.Done;
  119. end.
  120.